const { sequelize, DataTypes } = require('../utill/getSequelize')


const T_exam_target = sequelize.define('T_exam_target', {

    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
    },

    target_name: {
        type: DataTypes.STRING,
    },

    target_desc: {//对应的标签
        type: DataTypes.JSON,
    },

    target_content: {
        type: DataTypes.STRING,
    },

    t_user_and_a_c_s_id: {
        type: DataTypes.INTEGER
    },

    sub_id: {
        type: DataTypes.INTEGER
    },


    // //一个课程目标对应一个指标点
    // point_id: {
    //     type: DataTypes.INTEGER
    // },

    // point_deep: {
    //     type: DataTypes.INTEGER
    // }

});

// const { Index_Point } = require('./Course outline/index_Point')
// T_exam_target.belongsTo(Index_Point, {
//     foreignKey: 'point_id',
//     targetKey: 'id'
// });




//同步模型和数据库表
(async () => {
    try {
        await sequelize.sync({ force: false });
        console.log('All models were synchronized successfully.');
    } catch (error) {
        console.log(error);
    }

})();

//提供出去
module.exports = { T_exam_target };